home *** CD-ROM | disk | FTP | other *** search
- import java.awt.*;
- import java.applet.*;
-
- public class UIApplet extends Applet {
- public void init() {
- setLayout(new BorderLayout());
-
- setBackground(Color.red);
- setForeground(Color.white);
-
- add("North", new Button("North"));
- add("South", new Button("South"));
-
- Panel p = new Panel();
- p.setBackground(Color.lightGray);
- p.setLayout(new BorderLayout());
- add("Center", p);
- p.add("North", new Button("North"));
- p.add("South", new Button("South"));
- p.add("Center", new Button("Center"));
- p.add("West", new Button("West"));
- p.add("East", new Button("East"));
-
- add("West", new Button("West"));
- add("East", new Button("East"));
- }
- public boolean action(Event evt, Object arg) {
- showStatus(((Button)evt.target).getLabel());
- return true;
- }
- }
-